import request from '@/utils/request'

//GET 账变记录
export function walletrecordlist(params) {
  // status
  var statusQuery
  if(params.status.length > 0){
      statusQuery = params.status.join(",");
  }else{
      statusQuery = ''
  }
  return request({
    url: `/member/wallet/record/list?status=${statusQuery}&`,
    method: 'get',
    params
  })
}
// 充值列表
export function ApiRechargeList(params) {
  return request({
    url: '/order/recharge/list',
    method: 'get',
    params
  })
}
// 提现列表
export function ApiWithdrawList(params) {
  return request({
    url: '/order/withdraw/list',
    method: 'get',
    params
  })
}

// 充值详情
export function ApiRechargeDetail(id) {
  return request({
    url: `/order/recharge/info/${id}`,
    method: 'get'
  })
}
// 充值提交
export function ApiRechargeSubmit(data) {
  return request({
    url: '/order/recharge/create',
    method: 'post',
    data
  })
}
//提现提交
export function ApiWithdrawSubmit(data) {
  return request({
    url: '/order/withdraw/create',
    method: 'post',
    data
  })
}
//获取默认银行卡信息 ==》GET /member/bank/default
export function bankDefault(params) {
  return request({
    url: '/member/bank/default',
    method: 'get',
    params
  })
}

//查询会员银行卡信息列表 ==》GET /member/bank/list
export function getbankList(params) {
  return request({
    url: '/member/bank/list',
    method: 'get',
    params
  })
}
//添加银行卡信息列表 ==》POST /member/bank/list
export function memberbanklistAdd(data) {
  return request({
    url: '/member/bank/add',
    method: 'post',
    data
  })
}

//获取银行卡详情 ==GET /member/bank/info/{id}
export function getbankInfo(params) {
  return request({
    url: '/member/bank/info/'+params.id,
    method: 'get',
    params
  })
}

//删除会员银行卡信息 ==POST /member/bank/del/{id1,id2,id3}
export function bankDel(data) {
  return request({
    url: '/member/bank/del/'+data.id + '/' +data.code,
    method: 'post',
    data
  })
}

//修改银行卡信息列表 ==》POST /member/bank/update
//传参和添加一样，不过要传id
export function bankUpdate(data) {
  return request({
    url: '/member/bank/update',
    method: 'post',
    data
  })
}




// 获取默认钱包信息：GET /member/walletAddress/default
export function walletAddressDefault(params) {
  return request({
    url: '/member/walletAddress/default',
    method: 'get',
    params
  })
}

// 获取所有钱包信息：GET /member/walletAddress/list
// 分页参数：pageSize、pageNum
export function walletAddresslLst(params) {
  return request({
    url: '/member/walletAddress/list',
    method: 'get',
    params
  })
}

// 新增认钱包信息：POST /member/walletAddress/add
// json传参：
export function walletAddressAdd(data) {
  return request({
    url: '/member/walletAddress/add',
    method: 'post',
    data
  })
}
//修改钱包信息/member/walletAddress/update
export function walletAddressUpdate(data) {
  return request({
    url: '/member/walletAddress/update',
    method: 'post',
    data
  })
}
//删除钱包：GET /member/walletAddress/del/{多个id}
export function walletAddressdel(data) {
  return request({
    url: '/member/walletAddress/del/'+data.id + '/' +data.code,
    method: 'post',
    data
  })
}
//银行卡提现
export function setbankWithdraw(data) {
  return request({
    url: '/order/withdraw/bankWithdraw',
    method: 'post',
    data
  })
}
